<?php
/**
 * 캐쉬 쓰기 - Abstract
 *
 * @package util
 * @subpackage cache
 *
 * @author jylee3@simplexi.com
 * @version 1.0
 */
abstract class utilCacheWriterAbstract
{
    private static $aInstance = array();

    abstract public function __construct(utilCacheConfig $cacheConfig);

    /**
     * 캐쉬 쓰기 파서 객체 반환
     *
     * @param    String    $sWriterParser
     *
     * @return    utilCacheWriterParserAbstract
     */
    protected function getWriterParser($sWriterParser)
    {
        $sWriterParser = ucfirst(strtolower($sWriterParser));

        $sWriterParserClassName = 'utilCacheWriterParser'.$sWriterParser;

        if (!isset(self::$aInstance[$sWriterParserClassName])) {
            self::$aInstance[$sWriterParserClassName] = new $sWriterParserClassName;
        }

        return self::$aInstance[$sWriterParserClassName];
    }
}
